//导入 创建mainbox的嵌套路由数据 
import Home from "@/views/home/Home.vue"
import Center from "@/views/center/Center.vue"
import UserAdd from "@/views/user-manage/UserAdd.vue"
import UserList from "@/views/user-manage/UserList.vue"
import NewsAdd from "@/views/news-manage/NewsAdd.vue"
import NewsList from "@/views/news-manage/NewsList.vue"
import ProductAdd from "@/views/product-manage/ProductAdd.vue"
import ProductList from "@/views/product-manage/ProductList.vue"
import NoteFound from "@/views/notefound/NoteFound.vue"

const routes = [
	{
		path:"/index",
		component:Home
	},
	{
		path:"/center",
		component:Center
	},
	{
		path:"/user-manage/UserAdd",
		component:UserAdd
	},
	{
		path:"/user-manage/UserList",
		component:UserList
	},
	{
		path:"/news-manage/NewsAdd",
		component:NewsAdd
	},
	{
		path:"/news-manage/NewsList",
		component:NewsList
	},
	{
		path:"/product-manage/ProductAdd",
		component:ProductAdd
	},
	{
		path:"/product-manage/ProductList",
		component:ProductList
	},
	{
		//当用户输入主域时候 重定向到index首页
		path:'/',
		redirect:"/index"
	},
	{
		//配置错误路径404
		path:"/:pathMatch(.*)*",// 捕获所有未匹配的路径 当用户访问的 URL 没有匹配任何已定义的路由 时，Vue Router 会将未匹配的部分路径存储在 pathMatch 属性中。它通常与 通配符路由（path: '/:pathMatch(.*)*'） 结合使用。
		name:"Notfound",
		component:NoteFound
	}
	

]

//导出路由数组
export default routes